<%@ page import="org.springframework.security.core.context.SecurityContextHolder"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<html>
<head>
<link href="<%= request.getContextPath() %>/resources/css/dropdown/dropdown.css" media="screen" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath() %>/resources/css/dropdown/themes/default/default.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="mainMenu" align="right">
	<ul class="dropdown dropdown-horizontal">
		<li><a href="<%= request.getContextPath() %>/">Start</a></li>
		<li><span class="dir">Mój profil</span>
			<ul>
				<li><a href="<%= request.getContextPath() %>/user/update" class="dir">Edytuj dane</a></li>
				<li><a href="<%= request.getContextPath() %>/user/changePassword" class="dir">Zmień haslo</a></li>
			</ul>
		</li>
		<li><span class="dir">Moje szkolenia</span>
			<ul>
				<li><a href="<%= request.getContextPath() %>/course/list" class="dir">Moje szkolenia</a></li>
				<li><a href="<%= request.getContextPath() %>/course/listAll" class="dir">Wszystkie szkolenia</a></li>
			</ul>
		</li>
		<li><a href="<%= request.getContextPath() %>/course/results">Moje wyniki</a></li>
		<li><a href="<%= request.getContextPath() %>/course/schedule">Harmonogram</a></li>
		<%
		if(SecurityContextHolder.getContext().getAuthentication().getAuthorities().toString().indexOf("ROLE_ADMIN")==-1)
		{%>
		<li><a href="<%= request.getContextPath() %>/help">Pomoc</a></li>
		<%}%>
		<%
		if(SecurityContextHolder.getContext().getAuthentication().getAuthorities().toString().indexOf("ROLE_ADMIN")>-1)
		{%>
			<li><span class="dir">Admin</span>
				<ul>
					<li><a href="<%= request.getContextPath() %>/user/listAll" >Wydruki</a></li>
				</ul>
			</li>
		<%}%>
	</ul>
	<table height="100%"><tr><td height="100%" valign="middle">
	Witaj<b> <%= SecurityContextHolder.getContext().getAuthentication().getName() %></b> 
	[ <a href="<%= request.getContextPath() %>/j_spring_security_logout" style="color:#000000">
		Wyloguj
	</a> ]&nbsp;
	</td></tr></table>
</div>
 
</body>
</html>